﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace SharedLib.Engine
{
    public class TextureGenerator
    {
        private static Dictionary<Color, Texture2D> textures = new Dictionary<Color, Texture2D>();

        public static Texture2D getColorTexture(GraphicsDevice g, Color c)
        {
            if(textures.ContainsKey(c))
                return textures[c];

            Texture2D retour;

            Color[] colorAray = new Color[1];
            colorAray[0] = c;

            retour = new Texture2D(g, 1, 1);
            retour.SetData(colorAray);
            textures.Add(c, retour);
            return retour;
        }


    }
}
